package com.example.demo.service;

import com.example.demo.mapper.ArticleMapper;
import com.example.demo.model.ArticleInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2023-02-14
 * Time: 11:54
 */
@Service
public class ArticleService {

    @Autowired
    ArticleMapper articleMapper;

    public List<ArticleInfo> getMyList(Integer uid) {
        return articleMapper.getMyList(uid);
    }

    public ArticleInfo getDetail(Integer aid) {
        return articleMapper.getDetail(aid);
    }

    public Integer artDel(Integer aid) {
        return articleMapper.artDel(aid);
    }

    public int rcountAdd(Integer aid,Integer rcount) {
        return articleMapper.rcountAdd(aid,rcount);
    }

    public int update(Integer aid,Integer uid,String title,String content) {
        return articleMapper.update(aid,uid,title,content);
    }

    public int releaseArt(String title,String content,Integer uid) {
        return articleMapper.releaseArt(title,content,uid);
    }

    public int draftArt(String title,String content,Integer uid,Integer state) {
        return articleMapper.draftArt(title,content,uid,state);
    }

    public int publishArt(Integer aid,Integer state) {
        return articleMapper.publishArt(aid,state);
    }

    public int getTotalCount() {
        return articleMapper.getTotalCount();
    }

    public List<ArticleInfo> getList(Integer psize,Integer offset) {
        return articleMapper.getList(psize,offset);
    }
}
